package com.xueyi.aixihu.reqeust.base;

import lombok.Data;

/**
 * 描述 分页的基础Req
 *
 * @auther 俞烨
 * @date 2022-05-29 16
 */
@Data
public class PageLimitReq {

    /**
     * 分页条件
     */
    private Integer page = 1, limit = 5, startIndex = 0;


    public void countStartIndex() {
        if (page < 1 || limit < 1) {
            page = 1;
            limit = 1;
        }

        startIndex = (page - 1) * limit;
    }
}
